import '../styles/base.less';

import {Layout} from '../components/layout';
import {NavBar, NavBarBackIcon, NavBarNextIcon} from '../components/navbar';
import {TabBar, TabBarItem} from '../components/tabbar';
import {LinkItem} from '../components/linkItem';
import {GridsItem, GridsGroup} from '../components/grids';
import {Icons} from '../components/icons';

window.document.addEventListener('touchstart', function (event) {
    /* Do Nothing */
}, false);

const install = function (Vue) {
    Vue.component(Layout.name, Layout);
    Vue.component(NavBar.name, NavBar);
    Vue.component(NavBarBackIcon.name, NavBarBackIcon);
    Vue.component(NavBarNextIcon.name, NavBarNextIcon);
    Vue.component(TabBar.name, TabBar);
    Vue.component(TabBarItem.name, TabBarItem);
    Vue.component(LinkItem.name, LinkItem);
    Vue.component(GridsItem.name, GridsItem);
    Vue.component(GridsGroup.name, GridsGroup);
    Vue.component(Icons.name, Icons);

    // Vue.prototype.$dialog = {
    //     confirm: Confirm,
    //     alert: Alert,
    //     toast: Toast,
    //     notify: Notify,
    //     loading: Loading,
    // };
};

if (typeof window !== 'undefined' && window.Vue) {
    install(window.Vue);
}

export default {
    install
};
